import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from './router'
import store from './store'
import './styles/index.scss'
import './assets/icon.css'
Vue.use(ElementUI);
Vue.config.productionTip = false

import axios from "axios"
Vue.prototype.$axios = axios


// 白名单
/**
 * 路由前置守卫
 */
router.beforeEach((to, from, next) => {
  console.log(to.path);
  if(to.path!=="/"){
    if(!localStorage.token){
      next('/')
    }
  }
 next()
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
